A multithreaded program is a program that is capable of having two or more threads that can each be simultaneously executed by a different processor of a multiprocessor system or a different core of a multicore processor. Executing two or more threads of the program simultaneously can increase the processing speed of the program and/or the efficiency of the computer. Although each thread is executed by a single processor or core, it is common for threads to share other resources (e.g., memory) of the computer. As a result, two or more threads of a multithreaded program may access the same shared resource. For example, one thread may execute code that writes a value of a shared memory location at approximately the same time (e.g., shortly before or after) that another thread executes code that reads the shared memory location.